Purely Functional 1-2 Brother Trees
نویسنده
چکیده
Enter the computing arboretum and you will find a variety of well-studied trees: AVL trees (Adel’son-Vel’skiı̆ & Landis, 1962), symmetric binary B-trees (Bayer, 1972), Hopcroft’s 2-3 trees (Aho et al., 1974), the bushy finger trees (Guibas et al., 1977), and the colourful red-black trees (Guibas & Sedgewick, 1978). In this pearl, we look at a more exotic species of balanced search trees, 1-2 brother trees (Ottmann et al., 1979), which deserves to be better known. Brother trees lend themselves well to a functional implementation with deletion (Sec. 5) as straightforward as insertion (Sec. 3), both running in logarithmic time. Furthermore, brother trees can be constructed from ordered lists in linear time (Sec. 4). With some simple optimisations in place, this implementation of search trees is one of the fastest around. So, fasten your seat belts.
منابع مشابه
Automatic Functional Correctness Proofs for Functional Search Trees
In a new approach, functional correctness specifications of insert/update and delete operations on search trees are expressed on the level of lists by means of an inorder traversal function that projects trees to lists. With the help of a small lemma library, functional correctness and preservation of the search tree property are proved automatically (in Isabelle/HOL) for a range of data struct...
متن کاملVerified Analysis of Functional Data Structures
In recent work the author has analyzed a number of classical functional search tree and priority queue implementations with the help of the theorem prover Isabelle/HOL. The functional correctness proofs of AVL trees, red-black trees, 2-3 trees, 2-3-4 trees, 1-2 brother trees, AA trees and splay trees could be automated. The amortized logarithmic complexity of skew heaps, splay trees, splay heap...
متن کاملThe Arithmetic of Even-Odd Trees
Even-Odd Trees are a canonical tree-based number representation derived from a bijection between trees defined by the data type equation T = 1 + T ∗ T ∗ + T ∗ T ∗ and positive natural numbers seen as iterated applications of o(x) = 2x and i(x) = 2x+ 1 Starting from 1. This paper introduces purely functional arithmetic algorithms for operations on Even-Odd Trees. While within constant factors fr...
متن کاملBrother trees: A family of optimal 1p-hamiltonian and 1-edge hamiltonian graphs
In this paper we propose a family of cubic bipartite planar graphs, brother trees, denoted by BT(n) with n 2. Any BT(n) is hamiltonian. It remains hamiltonian if any edge is deleted. Moreover, it remains hamiltonian when a pair of nodes (one from each partite set) is deleted. These properties are optimal. Furthermore, the number of nodes in BT(n) is 6 · 2n − 4 and the diameter is 2n+ 1. 2003 ...
متن کاملQuickChecking Patricia Trees
Patricia trees are a space-efficient, purely functional data structure, useful for efficiently implementing both integer sets and dictionaries with integer keys. In this paper we illustrate how to build a QuickCheck model of the data structure for the purpose of testing a mature OCaml library implementing it. In doing so, we encounter a subtle bug, initially inherited from a paper by Okasaki an...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
برای دانلود متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید
ثبت ناماگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید
ورودعنوان ژورنال:
- J. Funct. Program.
دوره 19 شماره
صفحات -
تاریخ انتشار 2009